﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VisualPoint.Controls.Environments;

namespace VisualPoint.Controls.Actions
{
    public class StandardWindowItemCollection : Collection<StandardWindowItem>
    {

        private static StandardWindowItemDictionary _Dictionary;
        public static StandardWindowItemDictionary Dictionary
        {
            get
            {
                if (_Dictionary == null)
                {
                    CreateItems();

                }
                return _Dictionary;
            }
        }

        private static StandardWindowItemCollection _Default;
        public static StandardWindowItemCollection Default
        {
            get
            {
                if (_Default == null)
                {
                    CreateItems();
                }
                return _Default;
            }
        }

        private static void CreateItems()
        {
            _Default = new StandardWindowItemCollection();
            _Dictionary = new StandardWindowItemDictionary();

            AddItem(new StandardWindowItem(DteConstants.vsWindowKindAutoLocals, "Auto Locals"));
            AddItem(new StandardWindowItem(DteConstants.vsWindowKindCallStack, "Call Stack"));
            AddItem(new StandardWindowItem(DteConstants.vsWindowKindClassView, "Class View"));
            AddItem(new StandardWindowItem(DteConstants.vsWindowKindCommandWindow, "Command Window"));
            AddItem(new StandardWindowItem(DteConstants.vsWindowKindDocumentOutline, "Document Outline"));
            AddItem(new StandardWindowItem(DteConstants.vsWindowKindDynamicHelp, "Dynamic Help"));
            AddItem(new StandardWindowItem(DteConstants.vsWindowKindFindReplace, "Find Replace"));
            AddItem(new StandardWindowItem(DteConstants.vsWindowKindFindResults1, "Find Results 1"));
            AddItem(new StandardWindowItem(DteConstants.vsWindowKindFindResults2, "Find Results 2"));
            AddItem(new StandardWindowItem(DteConstants.vsWindowKindFindSymbol, "Symbol"));
            AddItem(new StandardWindowItem(DteConstants.vsWindowKindFindSymbolResults, "Symbol Results"));
            AddItem(new StandardWindowItem(DteConstants.vsWindowKindLinkedWindowFrame, "Linked Window Frame"));
            AddItem(new StandardWindowItem(DteConstants.vsWindowKindLocals, "Locals"));
            AddItem(new StandardWindowItem(DteConstants.vsWindowKindMacroExplorer, "Macro Explorer"));
            AddItem(new StandardWindowItem(DteConstants.vsWindowKindMainWindow, "Main Window"));
            AddItem(new StandardWindowItem(DteConstants.vsWindowKindObjectBrowser, "Object Browser"));
            AddItem(new StandardWindowItem(DteConstants.vsWindowKindOutput, "Output"));
            AddItem(new StandardWindowItem(DteConstants.vsWindowKindProperties, "Properties"));
            AddItem(new StandardWindowItem(DteConstants.vsWindowKindResourceView, "Resource View"));
            AddItem(new StandardWindowItem(DteConstants.vsWindowKindServerExplorer, "Server Explorer"));
            AddItem(new StandardWindowItem(DteConstants.vsWindowKindSolutionExplorer, "Solution Explorer"));
            AddItem(new StandardWindowItem(DteConstants.vsWindowKindTaskList, "Task List"));
            AddItem(new StandardWindowItem(DteConstants.vsWindowKindThread, "Thread"));
            AddItem(new StandardWindowItem(DteConstants.vsWindowKindToolbox, "Toolbox"));
            AddItem(new StandardWindowItem(DteConstants.vsWindowKindWatch, "Watch"));
            AddItem(new StandardWindowItem(DteConstants.vsWindowKindWebBrowser, "Web Browser"));
        }

        private static void AddItem(StandardWindowItem item)
        {
            _Default.Add(item);
            _Dictionary.Add(item.Name, item);
        }
    }
}
